//const curDate = getDate();
//const curTime = getTime();
function getDate(type){  
	var date = new Date();
	let year = date.getFullYear();
	let month = date.getMonth() + 1;
	let day = date.getDate();
	
	if (type === 'start') {
		year = year - 60;
	} else if (type === 'end') {
		year = year + 2;
	}
	month = month > 9 ? month : '0' + month;
	day = day > 9 ? day : '0' + day;
	return `${year}-${month}-${day}`;
}
function getTime(){
	var date = new Date();
	let hour = date.getHours() < 10 ? "0" + date.getHours():date.getHours();
	let minute = date.getMinutes() < 10 ? "0" + date.getMinutes():date.getMinutes();
	let second = date.getSeconds() < 10 ? "0" + date.getSeconds():date.getSeconds();
	
	return `${hour}:${minute}:${second}`;
}

module.exports = {
	getDate,
	getTime
}